﻿using System;

namespace Com.Harvin.Bug
{
    /// <summary>
    /// 定义一个特性，用于描述开发过程中bug的相关信息，用于跟踪记录
    /// </summary>
    [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method | AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Constructor, AllowMultiple = true)]
    public class BugInfo : Attribute
    {
        private int bugNo = 0;
        private string developer = null;
        private string lastReview = null;
        private string message = null;
        /// <summary>
        /// Bug编号
        /// </summary>
        public int BugNo { get { return bugNo; } }
        /// <summary>
        /// 编写代码的开发者
        /// </summary>
        public string Developer { get { return developer; } }
        /// <summary>
        /// 修改的时间
        /// </summary>
        public string LastReview { get { return lastReview; } }
        /// <summary>
        /// 有关于这个Bug的详细描述信息
        /// </summary>
        public string Message { get { return message; } }
        /// <summary>
        /// 构造方法
        /// </summary>
        /// <param name="bugNo">bug的编号</param>
        /// <param name="developer">开发人员</param>
        /// <param name="lastReview">修改时间</param>
        /// <param name="message">有关于bug的详细信息</param>
        public BugInfo(int bugNo, string developer, string lastReview, string message)
        {
            this.bugNo = bugNo;
            this.developer = developer;
            this.lastReview = lastReview;
            this.message = message;
        }
    }
}
